https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/description/
class Solution {
public:
    int maxProfit(vector<int>& prices) {
        int min=prices[0],sell=1,n=prices.size(),money=0;
        while(sell<n)
        {
            min=min<prices[sell]?min:prices[sell];
            money=max(prices[sell]-min ,money);
            ++sell;
        }
    return money;
    }
};